﻿using System;

namespace _027_对象初始化器与可选参数
{
    public class Bunny
    {
        public string Name;
        public bool LikesCarrots;
        public bool LikesHumans;

        public Bunny() { }
        public Bunny(string n) { Name = n; }
        public Bunny(string name,bool likesCarrots=false,bool likesHumans=false)
        {
            Name = name;
            LikesCarrots = likesCarrots;
            LikesHumans = likesHumans;
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Bunny b1 = new Bunny(name: "Bo", likesCarrots: true);
        }
    }
}
